﻿// code on a keyframe on the main timeline
// firefox-friendly getURL from projector
// works if IE is default browser too

var swfUrl:String = _root._url;
var lastSlashIndex:Number = swfUrl.lastIndexOf("/");
var pipeIndex:Number = swfUrl.indexOf("|");
var baseUrl:String;
if (pipeIndex >= 0)
{
    baseUrl = swfUrl.substring(0, pipeIndex);
    baseUrl += ":";
}
else
{
    baseUrl = "";
}
baseUrl += swfUrl.substring(pipeIndex + 1, lastSlashIndex + 1);

myButton.onRelease = function()
{
    var targetUrl:String = baseUrl + "test.html";
    getURL(targetUrl, "_blank");
};